package com.jeespring.designpattern.abstractfactory;

/**
 * @Title: VegetableFactory
 * @Description:
 * @Author 张朝阳
 * @Date 2021/1/3 15:27
 */
public class VegetableFactory extends AbstractFactory{

    /**
     * @description: 生产蔬菜
     * @param vegetableName
     * @return Fruit
     * @author 张朝阳
     * @date 2021/1/3 15:28
     */
    public Vegetable getVegetable(String vegetableName){
        if ("西红柿".equals(vegetableName)){
            return new Tomato();
        }else if ("土豆".equals(vegetableName)){
            return new Potato();
        }else if ("洋葱".equals(vegetableName)){
            return new Onion();
        }else {
            return null;
        }
    }

    @Override
    public Fruit getFruit(String fruitName) {
        return null;
    }
}
